<script setup lang="ts">
const options = ref([
  { label: '选项1', value: '1', disabled: true },
  { label: '选项9', value: '9' },
  { label: '选项10', value: '10' },
]);

const formData = ref({
  value: '11',
  label: '选项11',
  values: ['10', '11'],
  labelStr: '选项10, 选项11',
  valueStr: '10,11',
});

const handleChange = (value: any) => {
  console.log(value);
  console.log(formData.value);
};
</script>

<template>
  <section>
    <el-form :model="formData">
      <el-form-item label="ProSelect单选">
        <ProSelect
          v-model="formData.value"
          v-model:label="formData.label"
          :options="options"
          clearable
          filterable
          @change="handleChange"
        />
      </el-form-item>
      <el-form-item label="ProSelect多选">
        <ProSelect
          v-model="formData.values"
          v-model:label="formData.labelStr"
          v-model:value="formData.valueStr"
          :options="options"
          multiple
          clearable
          fliterable
          @change="handleChange"
        />
      </el-form-item>
      <el-form-item label="单选">
        <el-select v-model="formData.value" placeholder="请选择">
          <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" />
        </el-select>
      </el-form-item>
      <el-form-item label="多选">
        <el-select v-model="formData.values" placeholder="请选择" multiple>
          <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" />
        </el-select>
      </el-form-item>
    </el-form>
  </section>
</template>

<style lang="scss" scoped></style>
